In the configuration unit, the BUS section must be declared so that so that you have the hardware resources required for the implementation of the device ANPOS.
There must be at least a bi-directional counter and a 16-bit resolution analog output. The device can also used an input and an interrupt line for preset search functions.
In the INTDEVICE section of the configuration unit must be add the following definition:
;--------------------------------- ; Device declarations ;--------------------------------- INTDEVICE .. <device_name> ANPOS TCamp ICont IntL IAZero IOutA
![]() | It is necessary that each definition are present on the same line. In case you don't want to assign a resource, for example IAZero, you must enter in the appropriate field the X.X or X string. |
|---|
where:
| <device name> | Name assigned to device |
|---|---|
| ANPOS | Keyword that identifies the devices analog positioner. |
| TCamp | Sample time device 1÷255 ms) |
| ICont | Bidirectional counter input |
| IntL | Number of the interrupt line dedicated to the encoder zero pulse during the research phase of presets. Allowed values: 1÷8 (to prevent the device uses this resource, put the X character) |
| IAZero | Input of enabled to acquire the transducer's zero pulse during the preset search (to prevent device use this resource type the characters X.X) |
| IOutA | Hardware address of the DAC from analog output |
;--------------------------------- ; Device declarations ;--------------------------------- INTDEVICE Asse_X ANPOS 2 2.CNT02 3 3.INP01 3.AN01
The ANPOS device acquires the position of axis via bi-directional transmitter signals;
these signals are used by an internal counter. This counter does not show directly the position of the axis in the unit of measure required by your application.
The cntratio parameter is used to express the relationship between pulses
transducer and the corresponding application units. The permitted values for this parameter are 0,00374 ÷ 4 with five precision digits. The report must be introduced in
parameter as an integer, and then multiplied by 100000.
cntratio = (value in um) x 10 decimal digits / (corresponding transmitter pulse) x 100000
If for the selected measure unit is also provided for the presence of a decimal point, the positions must be represented always as an integer value and represent space on the measure unit without the decimal point. The resolution must be calculated with the same formula and the numerator the measure without decimal point. The decimal point will be entered in the value representing the time viewers (example as properties in the terminal operator).
The speeds are always expressed in whole units of measure in the unit of time choice. From this it emerges that the device must know the location of the decimal point of the unit of measure and this is done with the decpt parameter. This parameter can take 0÷3 values.
![]() | To activate this device send the INIT command. |
|---|
To calculate the resolution you have to consider the space runs represented in terms of the measuring mm unit. For this the resolution is:
cntratio = (18.2 x 101 / 500) x 100000 = 36400
The settings must be:
Axis:cntratio = 36400
Axis:decpt = 1
To run a placement at 146 cm, put
Axis:setpos = 1460
For setting the 10 centimeters per second must put:
Axis:unitvel = 1
Axis:setvel = 10
![]() | Before starting actual placements you must make sure that electrical connections and mechanical appliances have not cause malfunctions. |
|---|
For axis management, thee ANPOS device using an analogue output with 16-bit resolution with 10 V range ± and sign; with the calibration function this analog output can be driven with a constant value in order to test links and functionality.
The ANPOS device raises the voltage value of the analogue output on the basis between the maximum speed of the axis and the maximum output voltage proportion. La proporzionalità è ottenuta with the maxvel parameter, maximum axis speed representative on the analog voltage (10 V). The axis must behave symmetrical analog voltage to zero, therefore the speed must be the same on both the positive and negative voltage at maximum.
Before you determine the value of the maximum speed, must establish the unit of time to use for the representation of the speed in the device; the unitvel parameter defines the unit of time of speed (Um/min or Um/s).
The theoretical method is a calculation that was performed on the basis of the maximum speed of the motor. Set the maximum revolutions per minute engine declared, we get the maximum speed.
Setting in the maxvel parameter the maximum speed value calculated.
The practical way is based on the reading of the speed detected by the device in the vel variable, giving the drive a voltage. To provide the voltage to drive the device should be placed in a position of calibration as described in the previous paragraph. If the system permits, supply voltage operation of 10 V and read the speed value in the vel parameter. If, on the backwards, is an excerpt of the output voltage (1, 2, … 5 V), calculate the maximum speed with the proportion: vout : 10 [V] = vel : maxvel
Enter the maximum speed value found in maxvel parameter.
![]() | Before handling the Board, check the proper operation of emergency equipment and protection. |
|---|
The procedures were allowed to complete the first phase of device settings. Now you can run smooth movement of the axis.
This first movement was done without speed feedback space. The placement may have been executed with some error introduced by the non-linearity of the components or imperfection in the maximum velocity calibration. Then if you enable feedback of space this error goes away.
The placement made in the preceding paragraph has been made without considering any position errors.
To check the correct position of the axis continuously and automatically, you must
have a feed-back on the position; for this reason introduces the control PID + FF algorithm including proportional, integral, derivative actions and feed-forward; the value of the analog output is given by the summation of actions feed forward, proportional, derivative and integrative.
This section describes a series of actions to adjust the parameters that affect this control.
In order to achieve a satisfactory adjustment is sufficient to use only the feedforward and proportional actions; integral and derivative actions are used only for adjustments under special conditions.
The feed-forward helps make the system more ready on positioning, by providing the analog output voltage proportional to the theoretical speed of positioning.
The contribution of this action can be adjusted with the feedfw parameter; this parameter is expressed as a portion of millesimal theoretical speed; so, to introduce such as 98.5% you must set 985 (MILS).
This action provides an proportional output to the instantaneous axis position error. The size of the proportional action is defined by the pgain parameter that defines the sensitivity of the system.
The pgain parameter is introduced in thousandths; the unit value of the gain (1000) provides an analog output to maximum value (10 V) concerning the maximum speed error. For maximum speed error means the space taken by axis - at the max speed - for the duration of the sampling time of the device.
Integrates the position error of the system over time set in integt parameter updating the output until the error is reset.
More decreases the integration time of the error, more faster the recovery system error,
but the system may become unstable and swung.
Anticipates the change of the motion of the system tends to eliminate the overshoot the positioning.
The size of change is calculated over time set in derivt parameter.
More higher the time of derivation of error and more faster is the transient error recovery system, But if you enter a value that is too high the system becomes unstable, tending to fluctuate.
Searching for presets is a procedure to synchronize the counter (posit parameter) with the real position of the axis. Can be performed in 3 different ways according to the prsmode parameter.
If enable the preset search with the PRESET command, the axis towards the position where you active the enable zero-pulse input of transducer with speed define by prsvel. The st_prson state you turn to report the current preset. When, in this motion, the axis active the input, reverses direction and starts with sprsvel speed.
The operation depends from the selected mode of loading (Mode 0 or Mode 1).
![]() | This procedure involves the movement of the axis and the use of the zero pulse enable input of the transducer. |
|---|
The deactivation of the enable input zero-pulse transducer, the preset quota is loaded on the counter (parameter posit=prspos).
Next, you disable the st_prson status and activate the st_prsok state to signal the end of search. This state remains active until the starting of a new procedure of presets; at the system startup this State is always to zero. See the picture 1.
| Picture 1: Loading presets using the only enabling cam. |
![]() |
![]() | This procedure involves the movement of the axis and the use of the zero pulse and zero pulse enable input of the transducer. |
|---|
At the deactivation of the enable input zero-pulse transducer, enables reading of the first zero-pulse provided by the transducer and on this signal, loads the preset quota in counting (parameter posit=prspos).
To load the share presets with 'Mode 1', the card which is attached to the zero-pulse trasducer must transmit this signal on one of the 8 hardware interrupt lines. The device must have been defined to use the same hardware interrupt line (see the definition in the .CNF file).
Subsequently, the axis is positioned at an presets quota, to disable the st_prson state and enable the st_prsok state for to signal the end of search; This State remains active until the starting of a new preset procedure. At the startup of the instrument the st_prsok parameter is always to zero. See the picture 2.
| Picture 2: Loading presets using the enable cam and the zero pulse of transducer. |
![]() |
![]() | This procedure does not provide for the handling of the axis and the use of the zero pulse enable transducer input. |
|---|
With this procedure, the search for preset does not perform any positioning. The load command of the preset quota is provided by the activation of the enable zero encoder input and the st_prsok state is set to one.
If the input is active, the load is continuously, while if at the startup the input is already active, the first upload is executed only after its deactivation and activation.
In some applications are required to place a large number of axes by moving a single axis at a time. The design choice falls on installing just one drive that depending on the axis to be placed electrically connects the motor interested in positioning; the transducer is always bound to its axis.
The ANPOS device allows you to control access to the DAC device REGON and REGOFF commands. In this way through the QCL application defines a set of device many axes to be placed; in the definition, all devices use the same DAC resource. (IOutA).
Normally all devices must be in the st_regoff = 1 state so you will not have access to the DAC apparatus. Before you start positioning, with the REGON command, the device is brought to the st_regoff = 0 state. Runs the positioning and, at the completion, the device is returned in the st_regoff = 1 State with the REGOFF command.
For no reason two devices simultaneously must be found in the st_regoff =0
state.
When the device is placed in the regoff position, the analog output remains fixed at the last voltage value called before the REGOFF command.
![]() | Changing the quota is accepted only if the new position is reached with direction in use and if the axis is not already when slowing down to reach the quota previously set. |
|---|
In some applications is needed to define the target quota during the motion, according to external events to the device. This feature translates into the ability to write to the current setpos parameter even with current placements.
When positioning you can also change the value of the posit counter. This function is usually used when a device must under certain conditions, continue a speed profile for a very long time, that exceeds the time axis takes to reach the limit quota (maxpos or minpos).
When positioning it is possible to vary the speed of the axis without affecting the location to get to. This operation can lead to an increase or a decrease in velocity, even more points with the same placement. This operation is accomplished with new writing in the setvel parameter.
When positioning can be varied even acceleration/deceleration times. For example, the device can start a placement with a very short ramp and once they reach the speed set, varied the tacc parameter and do a change of speed with a very long ramp.
For special applications the ramp time can be varied even during a change of speed, in this case the new time is put into immediately execution.
![]() | The command can be sent only if the axis is stopped, condition of st_still = 1. |
|---|
The device always shows the absolute position of the axis; to execute the incremental placements is need a tool to subtract or add some value to the count (posit) without introducing errors. The change can also count with a direct writing to the new value in the posit parameter.
Wanting to steal 100 units of measure from the counter you can:
Axis:posit = Axis:posit - 100
![]() | The changing at the value of resolution (cntratio) or the writing of the posit variable, causes the reset of the remnants of the conversion. |
|---|
This operation introduces an error because it imposes the location 'posit = -100', when the axis could have an intermediate position between a unit of measurement and subsequent (ex. 100.3). This fraction (0.3) is lost and the repetition of these steps will the accumulation of a considerable error.
The DELCNT command sum the count an amount equal to the parameter delta without losing the fraction part of the position:
Axis:delta = -100
DELCNT Axis
The DELCNT command may be sent only with stationary axis (st_still=1)
The axis position is of 2 units and is located at point A. You want to add to the posit counter three measure units.
With instructions:
Axis:posit = Axis:posit + 2
the axis takes the new B position.
With instructions :
Axis:delta = 2
DELCNT Axis
C position is reached.
Note that with the first instructions the axis took a delta less than 3 units and this introduced an error.
If you need to send the succession DELCNT commands, It is convenient to calculate the value to be summed and send once the command; otherwise beware not to send subsequent commands without a read statement on device parameter.
Axis:delta = 3
DELCNT Axis
WAIT Axis:st_init
Axis:delta = 40
DELCNT Axis
The parameter name, condition or command is taken back to the left side of the table.
R
Indicates whether the parameter or state is retentive (upon initialization of the device maintains the previously defined state), or the state assumes upon initialization of the device.
If the device does not need to initialize the 'R' field dicates the value that the parameter or state accept to the startup card.
R = Retentive
0 = Upon initialization of the device the value is forced to zero.
1 = Upon initialization of the device the value is forced to one.
- = Upon initialization of the device is presented significant value.
D
Indicates the size of the parameter.
F = Flag
B = Byte
W = Word
L = Long
S = Single Float
Describes all the conditions necessary so that the parameter is considered correct or because the command is accepted.
In some cases, limit values are specified for the acceptance of the parameter: if set any values outside the limits, the data is accepted; but must be monitoring the application that provided to ensure the proper functioning.
To run a command, all the conditions must be met; otherwise the command does not run.
A
Indicates the access mode.
R = Read.
W = Write.
RW = Read / Write.
Controls were ranked by decreasing priority. For example, in the case of contemporary INIT and EMRG controls, is acquired first the INIT command.
| Name | Conditions | Description |
|---|---|---|
| INIT | st_init = 1 | Initialization Initializing command device. If the device is not initialized does not perform the calculations related to the axis and then sits idle. To startup you can download all parameters in DPR; then, with the INIT command the axis will be inizialiazzato, by performing the calculations only once. Enable the st_init state. |
| EMRG | st_init = 1 | Emergency Emergency stopping axis poses, without deceleration ramp, any ongoing positioning. It also disabled the axis space reaction. |
| RESUME | st_init = 1 st_emrg = 1 | Resume Restore of emergency condition of axis; it's enable the axis space reaction. To the start, the axis resume the the positioning. |
| START | st_init = 1 st_regoff = 0 st_emrg = 0 st_cal = 0 st_still = 1 | Start Controls the positioning to the setpos quota and setvel speed. |
| STOP | st_init = 1 st_regoff = 0 st_emrg = 0 st_cal = 0 st_still = 0 | Stop Stops any ongoing axis positioning. The axis stop follows the deceleration ramp in use. The axis remains in reaction to space. |
| LOOPON | st_init = 1 | Loop ON Enables the reaction of space axis. The analog output sharpen every external action that attempts to move the axis from the reached position (drift, user, …). This operation resets any tracking follerr error. |
| LOOPOFF | st_init = 1 | Loop OFF Disable the reaction of space axis. The axis can be moved from this position without that the analogue output contrasts the movement. |
| CNTLOCK | st_init = 1 | Counter lock Blocks the acquisition of axis counter even if the transducer continues to send signals. At this stage the axis shift is not detected. Disables loading of presets on the counter. Activates the st_cntlock state. |
| CNTUNLOCK | st_init = 1 | Counter unlock Unlock the axis counter. Resumes reading of the signals sent from the transducer and the updating counter. Disable the st_cntlock state. |
| CNTREV | st_init = 1 | Counter reverse Invert the phases of the transducer in the card. Reverses the direction of the count (increase/decrease). Activates the st_cntrev state. |
| CNTDIR | st_init = 1 | Counter direct Counting the axis is reversed. Disable the st_cntrev state. |
| PRESET | st_init = 1 st_regoff = 0 st_emrg = 0 st_cal = 0 st_still = 1 | Preset Start axis presets search. Start to preset search procedure in the way set with prsmode and prsdir parameters. If the preset search is already running, the command performs the reverse search. Activates the st_prson state and disable the st_prsok state. |
| CALON | st_init = 1 | Calibration ON The analog output is used as a voltage source; in this case you cannot use it for positioning the axis. The output value is settable at will through the vout variable. |
| CALOFF | st_init = 1 st_cal = 1 | Calibration OFF The analog output is not used as voltage generator, so it can be used for managing placements. |
| MANFW | st_init = 1 st_regoff = 0 st_prson = 0 st_still = 1 | Manual forward Controls the forward manual positioning (towards maxpos) the set speed. |
| MANBW | st_init = 1 st_regoff = 0 st_prson = 0 st_still = 1 | Manual backward Controls the back manual positioning (towards minpos) the set speed. |
| REGOFF | st_init = 1 st_still = 1 | Regulation OFF Disable the adjustment and upgrading of the DAC, as well as all the movement commands. |
| REGON | st_init = 1 st_regoff = 1 | Regulation ON Restorte the adjustment and updating the DAC, as well as all the movement commands. |
| DELCNT | st_still = 1 st_init = 1 | Delta counter This command is accepted only if the axis is stopped; the counter (axis position) is modified by adding algebraically the value specified in the delta variable. |
| Name | D | R | A | Conditions | Description |
|---|---|---|---|---|---|
| cntratio | L | R | R-W | st_still = 1 | Counter ratio Defines how the transducer pulses must be multiplied so that the acquisition of movements is expressed in the unit of measure desired. By setting the count variation is 100000 1 bit per pulse transducer. Valid Range: 347 ÷ 400000 |
| maxpos | L | R | R-W | st_still = 1 | Maximum position Defines the maximum quota reached by the axis; the value set is to be considered also as an upper limit for the introduction of quotas of work. Value expressed in units of measurement (Um). Valid Range: -999999 ÷ 999999 |
| minpos | L | R | R-W | st_still = 1 | Minimum position Defines the minimum quota reached by the axis; the set value is considered as the lower limit for the introduction of quotas of work. Value expressed in units of measurement (Um). Valid Range: -999999 ÷ 999999 |
| prspos | L | R | R-W | st_still = 1 | Preset position Defines the value that is loaded on the counting with the preset search procedure. Valid Range: minpos÷maxpos |
| maxvel | L | R | R-W | st_still = 1 | Maximum velocity Defines the maximum speed axis (analogue reference +/-10V). The value is per unit of time of the set speed Velocity unit. Value expressed in Um/s or Um/min. Valid Range: 0 ÷ 999999 |
| prsvel | L | R | R-W | st_still = 1 | Preset velocity Defines the speed of the axis during the search procedure of presets. The input value is per unit of time of the set speed (Velocity unit). Valid Range: 0 ÷ maxvel |
| sprsvel | L | R | R-W | st_still = 1 | Preset search velocity In the preset search procedure, defines the axis speed in the acquisition zero-pulse phase. The input value is per unit of time of the set speed (Velocity unit). Valid Range: 0 ÷ prsvel |
| toll | L | R | R-W | st_still = 1 | Tolerance Defines a count range around locating dimensions. If the placement ends within this range, it is considered correct. Value expressed in (Um). Valid Range: -999999 ÷ 999999 |
| maxfollerr | L | R | R-W | None | Maximum following error Defines the maximum acceptable deviation between the theoretical position and the actual position of the axis. Value, in bits, transducer. Valid Range: 0 ÷ 2147483648 |
| rampmode | B | R | R-W | se st_still = 1 writing always enable, if st_still = 0 the new value is stored but processed only if the new time of acc. and dec. allow to reach the set quota. | Acceleration/deceleration time mode Used when choosing between acceleration and deceleration ramps equal or differentiated. Allowed values: 0 = equal ramps 1 = differentiated ramps |
| taccdec | W | R | R-W | se st_still = 1 writing always enable, if st_still = 0 the new value is stored but processed only if the new nuovi tempi of acc. and dec. allow to reach the set quota. | Acceleration/deceleration time Is the time required to go from 0 speed to maximum velocity and vice versa; the parameter is used if rampmode = 0. Value expressed in hundredths of a second. Valid Range: da 0 a 999 |
| tacc | W | R | R-W | se st_still = 1 writing always enable, if st_still = 0 the new value is stored but processed only if the new time allows you to reach the setting quota | Acceleration time Defines the necessary time for the axis to accelerate from zero to maximum speed (condition of stopped axis) at maximum speed. Value expressed in hundredths of a second. Valid Range: from 0 to 999 |
| tdec | W | R | R-W | se st_still = 1 writing always enable, if st_still = 0 the new value is stored but processed only if the new time allows you to reach the setting quota. | Deceleration time Defines the necessary time for the axis to decelerate from maximum speed to zero (condition of stopped axis). Value expressed in hundredths of a second. RaValid Range: from 0 to 999 |
| tinv | W | R | R-W | None | Direction inversion delay Is used to avoid mechanical stress caused by too rapid direction changes movement. Value expressed in hundredths of a second. Valid Range: from 0 to 999 |
| toldly | W | R | R-W | Nessuna | Tolerance delay Definisce il tempo che intercorre tra l'arrivo dell'asse nella fascia di tolleranza e la relativa segnalazione di stato. Valore espresso in centesimi di secondo. Range valido: da 0 a 999 |
| pgain | W | R | R-W | Nessuna | Proportional gain Impostando il valore 1000, il coefficente è 1.000 È il coefficiente che moltiplicato per l'errore di inseguimento genera la parte proporzionale dell'uscita di regolazione. Range valido: da 0 a 32767 |
| feedfw | W | R | R-W | Nessuna | Feed forward Impostando il valore 1000, la percentuale è del 100%. È il coefficiente percentuale che, moltiplicato per la velocità, genera la parte feed-forward dell'uscita di regolazione. Range valido: da 0 a 32767 |
| integt | W | R | R-W | Nessuna | Integral time È il tempo, espresso in millisecondi, che produce il coefficiente di integrazione dell'errore di inseguimento. L'integrazione di tale errore moltiplicata per tale coefficente genera la parte integrale dell'uscita di regolazione. Range valido: da 0 a 32767 |
| derivt | W | R | R-W | Nessuna | Derivative time È il tempo, espresso in millisecondi, che produce il coefficiente derivativo dell'errore di inseguimento. La derivazione di tale errore moltiplicata per tale coefficiente genera la parte integrale dell'uscita di regolazione. Range valido: da 0 a 32767 |
| prsmode | B | R | R-W | Nessuna | Preset mode Definisce il tipo di ricerca di preset: 0 = Per la ricerca dell'abilitazione impulso di zero, l'asse inizia il movimento in veloce, incontra la camma di abilitazione, inverte la direzione rallentando e, sul fronte di discesa relativo al segnale di camma, carica la quota di preset. 1 = Per la ricerca dell'abilitazione impulso di zero, l'asse inizia il movimento in veloce, incontra la camma di abilitazione, inverte la direzione ed in lento acquisisce il primo impulso di zero (dopo la disattivazione del segnale di camma). 2 = Non viene attivata la procedura di ricerca preset con movimentazione dell'asse. Il conteggio viene aggiornato alla quota di preset all'attivazione dell'abilitazione impulso di zero. |
| prsdir | B | R | R-W | Nessuna | Preset direction Definisce la direzione del movimento asse per la ricerca della camma di abilitazione impulso di zero. 0 = l'asse si dirige in avanti. 1 = l'asse si dirige indietro |
| unitvel | B | R | R-W | st_still = 1 | Velocity unit Definisce se l'unità di tempo della velocità è espressa in minuti o secondi. 0 = Um/min 1 = Um/sec |
| decpt | B | R | R-W | st_still = 1 | Decimal point Definisce la precisione con la quale si intendono impostare le preselezioni e visualizzare i conteggi relativamente all'asse. Range valido: da 0 a 3. |
| offset | W | R | R-W | Nessuna | Offset Offset uscita DAC in bit. Definisce il valore in bit della correzione relativa all'uscita analogica in modo da compensare l'eventuale deriva del sistema. Valore espresso in bit DAC. Range valido: da -32768 a 32767 |
| setpos | L | R | R-W | se st_still = 1 scrittura sempre abilitata , se st_still = 0 scrittura abilitata se la nuova quota puó essere raggiunta con la stessa direzione di posizionemato. Il parametro viene alterato se eseguita una ricerca di preset con prsmode = 0 o 1. | Setted position Definisce la quota di posizionamento raggiungibile dall'asse x alla velocità setvelx. Range valido: da minpos a maxpos N.B. Il valore viene alterato se si comanda una procedura di ricerca preset con prsmode = 0 o 1. |
| setvel | L | R | R-W | se st_still = 1 scrittura sempre abilita, se st_still = 0 il nuovo valore viene memorizzato ma processato solamente se l'asse non é in decelerazione per raggiungere la quota impostata. Il parametro viene alterato se eseguita una ricerca di preset con prsmode = 0 o 1. | Setted velocity É il valore della velocitá di posizionamento. Valore espresso in Um/s o Um/min. Range valido: 0 ÷ maxvel |
| vout | B | 0 | R-W | st_cal = 1 | Volt out É il valore della tensione di uscita, espressa in decimi di volts, da usare nella procedura di calibrazione. Range valido: -100 ÷ 100 |
| vel | L | 0 | R | Nessuna | Velocity É il valore della velocitá istantanea dell'asse. Valore espresso in Um/s o Um/min. |
| frq | L | 0 | R | Nessuna | Frequency É il valore della frequenza istantanea dell'asse. Valore espresso in Hz. |
| posit | L | R | R-W | se st_still = 1 scrittura sempre abilita, se st_still = 0 il nuovo valore viene processato solamente se l'asse non é in decelerazione per raggiungere la quota impostata. | Actual position É il valore della posizione istantanea dell'asse. Valore espresso in unità di misura (Um). |
| follerr | L | 0 | R | Nessuna | Following error É il valore istantaneo dell'errore di inseguimento. Valore espresso in bit trasduttore. |
| ffwdreg | L | 0 | R | Nessuna | Feed-forward register È il valore istantaneo del registro di feed-forward espresso in bit. |
| propreg | L | 0 | R | Nessuna | Proportional register È il valore istantaneo del registro proporzionale espresso in bit. |
| intreg | L | 0 | R | Nessuna | Integral register È il valore istantaneo del registro integrale espresso in bit. |
| derreg | L | 0 | R | Nessuna | Derivative register È il valore istantaneo del registro derivativo espresso in bit. |
| delta | L | R | R-W | Nessuna | Delta counter È il valore che viene sommato al conteggio quando viene inviato un comando DELCNT. Valore espresso in unità di misura (Um). Range valido: -999999 ÷ 999999 |
| Nome | D | R | A | Condizioni | Descrizione |
|---|---|---|---|---|---|
| st_init | F | 0 | R | Nessuna | Initialization Segnalazione di device inizializzato. 0 = device non inizializzato. 1 = device inizializzato. All'accensione per default viene caricato il valore zero. |
| st_emrg | F | 0 | R | Nessuna | Emergency Segnalazione di asse in emergenza. 0 = asse non in emergenza. 1 = asse in emergenza. |
| st_toll | F | 0 | R | Nessuna | Tolerance Segnalazione di asse in tolleranza rispetto alla quota posta in esecuzione dal comando di START. La segnalazione di asse in tolleranza può essere ritardata tramite il parametro toldly. 0 = asse non in tolleranza. 1 = asse in tolleranza. All'accensione per default viene caricato il valore zero. |
| st_prsok | F | 0 | R | Nessuna | Preset Ok Segnalazione di asse in tolleranza rispetto alla quota posta in esecuzione dal comando di START. La segnalazione di asse in tolleranza può essere ritardata tramite il parametro toldly. 0 = asse non in tolleranza. 1 = asse in tolleranza. All'accensione per default viene caricato il valore zero. |
| st_still | F | 0 | R | Nessuna | Still Segnalazione di asse fermo. 0 = asse in movimento. 1 = asse fermo. All'accensione per default viene caricato il valore 1. |
| st_prson | F | 0 | R | Nessuna | Preset ON Segnalazione di ricerca di preset asse in corso. 0 = ricerca di preset non in corso. 1 = ricerca di prest in corso. All'accensione per default viene caricato il valore zero. |
| st_movdir | F | 0 | R | Nessuna | Movement direction Segnalazione della direzione del movimento. 0 = avanti. 1 = indietro. All'accensione per default viene caricato il valore zero. |
| st_loopon | F | 0 | R | Nessuna | Loop ON Segnalazione di asse in reazione di spazio. 0 = asse non in reazione di spazio. 1 = asse in reazione di spazio. All'accensione per default viene caricato il valore zero. |
| st_foller | F | 0 | R | Nessuna | Following error Segnalazione di asse in errore di inseguimento (ritenuta 500 ms). 0 = asse non in errore di inseguimento. 1 = asse in errore di inseguimento. All'accensione per default viene caricato il valore 1. |
| st_regoff | F | 0 | R | Nessuna | Regulation Segnala che la regolazione é disabilitata e che l'aggiornamento del DAC non viene effettuato. |
| st_cal | F | 0 | R | Nessuna | Calibration Segnalazione di asse come generatore di tensione. 0 = generatore di tensione asse disattivo. 1 = generatore di tensione asse attivo. All'accensione per default viene caricato il valore zero. |
| st_cntlock | F | R | R | Nessuna | Counter locked Segnalazione di asse sbloccato. 0 = conteggio asse sbloccato. 1 = conteggio asse bloccato |
| st_cntrev | F | R | R | Nessuna | Counter revers Segnalazione di conteggio asse invertito. 0 = Conteggio asse non invertito. 1 = Conteggio asse invertito. All'accensione viene mantenuto lo stato presente allo spegnimento. |
| st_cntrev | F | R | R | Nessuna | Counter revers Segnalazione di conteggio asse invertito. 0 = Conteggio asse non invertito. 1 = Conteggio asse invertito. All'accensione viene mantenuto lo stato presente allo spegnimento. |
Nessuna limitazione
;*************************************************************************************
; Nome Modulo: Ex_Anpos.CNF Progetto: Ex_ANPOS
; Autore: QEM srl Data: 01/05/99
; Sistema: QMove1 / QCL3 Libreria: 1LIB3B04
; Funzionalità: Esempio gestione ANPOS Release: 0
;------------------------------------- Note ------------------------------------------
; [1] - Applicativo di esempio per utilizzo device ANPOS
**************************************************************************************
;-------------------------------------------------------------------------------------
; Definizione Costanti
;-------------------------------------------------------------------------------------
CONST
;-------------------------------------------------------------------------------------
; Definizione Variabili SYSTEM
;-------------------------------------------------------------------------------------
SYSTEM
slQuotaPos L ;Variabile per quota di posizionamento
slVelAsse L ;Variabile per velocità asse
;-------------------------------------------------------------------------------------
; Definizione Variabili GLOBAL
;-------------------------------------------------------------------------------------
GLOBAL
gfMovMan F ;Flag segnalazione movimenti
;manuali in corso
gfMovAuto F ;Flag segnalazione movimenti
;automatici in corso
;-------------------------------------------------------------------------------------
; Definizione Variabili TIMER
;-------------------------------------------------------------------------------------
TIMER
;-------------------------------------------------------------------------------------
; Definizione DATAGROUP
;-------------------------------------------------------------------------------------
;DATAGROUP
;-------------------------------------------------------------------------------------
; Configurazione Bus
;-------------------------------------------------------------------------------------
BUS
1 1CPUB 02
2 1MIXA 00
3 .
4 .
;-------------------------------------------------------------------------------------
; Definizione Variabili INPUT
;-------------------------------------------------------------------------------------
INPUT
ifAvMan F 2.INP01 ;Ingresso di avanti manuale
ifInMan F 2.INP02 ;Ingresso di indietro manuale
ifStart F 2.INP03 ;Ingresso di START asse
ifStop F 2.INP04 ;Ingresso di STOP asse
;-------------------------------------------------------------------------------------
; Definizione Variabili OUTPUT
;-------------------------------------------------------------------------------------
OUTPUT
ofToll F 2.OUT01 ;Uscita di asse in tolleranza
ofAxeFermo F 2.OUT02 ;Uscita di asse fermo
;-------------------------------------------------------------------------------------
; Dichiarazione device
;-------------------------------------------------------------------------------------
INTDEVICE
;Nome Tipo TCamp Contatore Inter AbilZero OutAnal
Asse ANPOS 0004 2.CNT01 1 2.INP01 2.AN01
END
;*************************************************************************************
; Nome File: TASK_00.MOD
; Progetto : EX_ANPOS
; Descrizione: Gestione Posizionamento
;*************************************************************************************
;-------------------------------------------------------------------------------------
; Operazioni di Inizializzazione Asse
;-------------------------------------------------------------------------------------
Asse:cntratio = 100000 ;Risoluz.encoder = Spazio in 1 giro
;encoder(Um) / impulsi giro encoder
Asse:maxvel = 100000 ;Velocita` max. = Velocità Asse con
;uscita analogica a 10V (CALON/
vout=100)
Asse:maxpos = 999999 ;Quota massima
Asse:minpos = -999999 ;Quota minima
Asse:maxfollerr = 10000 ;Errore di inseguimento
Asse:unitvel = 0 ;Unita di tempo della velocità
Asse:decpt = 0 ;Cifre decimali
Asse:rampmode = 0 ;Tipo di rampe utilizzate
Asse:taccdec = 100 ;Tempo di accelerazione e di decelerazione
Asse:tacc = 0 ;Tempo di accelerazione (non utilizzato)
Asse:tdec = 0 ;Tempo di decelerazione (non utilizzato)
Asse:tinv = 0 ;Tempo di inversione asse
Asse:toll = 5 ;Tolleranza
Asse:toldly = 10 ;Tempo di ritardo attivaz. tolleranza
Asse:prsmode = 0 ;Tipo di ricerca di preset
Asse:prspos = 0 ;Quota di preset
Asse:prsdir = 0 ;Direzione della ricerca di preset
Asse:prsvel = (20 * Asse:maxvel)/100 ;Velocità di preset (20% della
vel.max.)
Asse:sprsvel = (10 * Asse:maxvel)/100 ;Velocità di ricerca impulso di
;zero (10% della vel.max.)
Asse:offset = 0 ;Tensione di offset
Asse:pgain = 10 ;Guadagno proporzionale
Asse:feedfw = 1000 ;Feedforward
Asse:integt = 0 ;Tempo di integrale
Asse:derivt = 0 ;Tempo derivativo
INIT Asse ;Inizializza il device
WAIT Asse:st_init ;Attendi che il device sia inizializzato
CNTUNLOCK Asse ;Sblocca conteggio
WAIT NOT Asse:st_cntlock ;Attendi che il conteggio sia sbloccato
CNTDIR Asse ;Imposta il senso del conteggio
WAIT NOT Asse:st_cntrev ;Attendi che sia impostato il senso
;del conteggio
REGON Asse ;Abilita la regolazione
WAIT NOT Asse:st_regoff ;Attendi l'abilitazione alla regolazione
RESUME Asse ;Togli l'asse dallo stato di emergenza
WAIT NOT Asse:st_emrg ;Attendi che l'asse non sia in emergenza
LOOPON Asse ;Aggancia loop di reazione dell'asse
WAIT Asse:st_loopon ;Attendi che sia agganciato il loop di
;reazione dell'asse
IF (slVelAsse EQ 0) ;Nel caso in cui il set di velocità
;dell'asse sia zero
slVelAsse = 50 ;Imposta una velocità di posizionamento
ENDIF
IF (slQuotaPos EQ 0) ;Nel caso in cui la quota di
;posizionamento dell'asse sia zero
slQuotaPos = 2000 ;Imposta una quota di posizionamento
ENDIF
;-------------------------------------------------------------------------------------
; Operazioni di Posizionamento
;-------------------------------------------------------------------------------------
; ------------------------------- variabili utilizzate ------------------------------
; slVelAsse: Variabile impostabile che rappresenta la velocità dell'asse
; (espressa in % della vel.max.)
; slQuotaPos: Variabile impostabile che rappresenta la quota di posizionamento
dell'asse
; ---------------------------------- flag utilizzati --------------------------------
; gfMovMan: movimento manuale in corso
; gfMovAuto: Movimento automatico in corso
;-------------------------------------------------------------------------------------
MAIN:
;-------------------------------------------------------------------------------------
; Gestione uscite
;-------------------------------------------------------------------------------------
ofToll = Asse:st_toll ;Imposto l'uscita di tolleranza come
;lo stato di tolleranza
ofAxeFermo = Asse:st_still ;Imposto l'uscita di asse fermo come
;lo stato di asse fermo
;-------------------------------------------------------------------------------------
; Gestione movimenti automatici
;-------------------------------------------------------------------------------------
IF ifStart ;Attende l'ingresso di START
IF NOT gfMovMan ;Controlla che non ci siano movimenti
;manuali
IF Asse:st_still ;Controlla che l'asse sia fermo
Asse:setvel=(slVelAsse*Asse:maxvel)/100 ;Imposta la velocità dell'asse
Asse:setpos = slQuotaPos ;Imposta la quota di posizionamento
START Asse ;Esegue lo start dell'asse
gfMovAuto = 1 ;Segnala movimento automatico in corso
ENDIF
ENDIF
ENDIF
IF ifStop ;Attende l'ingresso di STOP
IF NOT Asse:st_still ;Controlla che l'asse NON sia fermo
STOP Asse ;Esegue lo stop dell'asse
ENDIF
ENDIF
IF gfMovAuto ;Controlla segnalazione movimento
;automatico in corso
IF Asse:st_still ;Controlla che l'asse sia fermo
gfMovAuto = 0 ;Resetta stato di movimento Automatico
ENDIF
ENDIF
;-------------------------------------------------------------------------------------
; Gestione movimenti manuali
;-------------------------------------------------------------------------------------
IF ifAvMan ;Attende l'ingresso di movimento manuale
IF NOT (gfMovAuto OR gfMovMan) ;Controlla che non ci siano movimenti
;automatici o manuali
IF Asse:st_still ;Controlla che l'asse sia fermo
Asse:setvel=(slVelAsse*Asse:maxvel)/100 ;Imposta la velocita` dell'asse
MANFW Asse ;Avanti asse in manuale
gfMovMan = 1 ;Segnala movimento manuale in corso
ENDIF
ENDIF
ENDIF
IF ifInMan ;Attende l'ingresso di movimento manuale
IF NOT (gfMovAuto OR gfMovMan) ;Controlla che non ci siano movimenti
;autometici o manuali
IF Asse:st_still ;Controlla che l'asse sia fermo
Asse:setvel=(slVelAsse*Asse:maxvel)/100 ;Imposta la velocita` dell'asse
MANBW Asse ;Avanti asse in manuale
gfMovMan = 1 ;Segnala movimento manuale in corso
ENDIF
ENDIF
ENDIF
IF gfMovMan ;Se l'asse si muove in manuale
IF NOT (ifAvMan OR ifInMan) ;Se gli ingressi di avanti e indietro
;manuale sono OFF
STOP Asse ;Ferma l'asse
gfMovMan = 0 ;Togli la segnalazione di asse in
;movimento manuale
ENDIF
ENDIF
;-------------------------------------------------------------------------------------
; Operazioni finali
;-------------------------------------------------------------------------------------
WAIT 1
JUMP MAIN
END